package com.lcz.wanandroid.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.lcz.wanandroid.base.User;
import com.lcz.wanandroid.base.Person;
import com.lcz.wanandroid.base.Check;
import com.lcz.wanandroid.base.SearchBean;

import com.lcz.wanandroid.dao.UserDao;
import com.lcz.wanandroid.dao.PersonDao;
import com.lcz.wanandroid.dao.CheckDao;
import com.lcz.wanandroid.dao.SearchBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig userDaoConfig;
    private final DaoConfig personDaoConfig;
    private final DaoConfig checkDaoConfig;
    private final DaoConfig searchBeanDaoConfig;

    private final UserDao userDao;
    private final PersonDao personDao;
    private final CheckDao checkDao;
    private final SearchBeanDao searchBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        personDaoConfig = daoConfigMap.get(PersonDao.class).clone();
        personDaoConfig.initIdentityScope(type);

        checkDaoConfig = daoConfigMap.get(CheckDao.class).clone();
        checkDaoConfig.initIdentityScope(type);

        searchBeanDaoConfig = daoConfigMap.get(SearchBeanDao.class).clone();
        searchBeanDaoConfig.initIdentityScope(type);

        userDao = new UserDao(userDaoConfig, this);
        personDao = new PersonDao(personDaoConfig, this);
        checkDao = new CheckDao(checkDaoConfig, this);
        searchBeanDao = new SearchBeanDao(searchBeanDaoConfig, this);

        registerDao(User.class, userDao);
        registerDao(Person.class, personDao);
        registerDao(Check.class, checkDao);
        registerDao(SearchBean.class, searchBeanDao);
    }
    
    public void clear() {
        userDaoConfig.clearIdentityScope();
        personDaoConfig.clearIdentityScope();
        checkDaoConfig.clearIdentityScope();
        searchBeanDaoConfig.clearIdentityScope();
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public PersonDao getPersonDao() {
        return personDao;
    }

    public CheckDao getCheckDao() {
        return checkDao;
    }

    public SearchBeanDao getSearchBeanDao() {
        return searchBeanDao;
    }

}
